<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<h:outputScript library="primefaces" name="jquery/jquery.js" />
	<h:outputStylesheet library="css" name="zona-menu.css" />
	<h:outputStylesheet library="css" name="zona-principal.css" />
	<h:outputStylesheet library="css" name="generico-venta-repuestos.css" />
	<h:outputStylesheet library="css" name="actualizacion-aristo.css" />		
	<h:outputStylesheet library="css" name="styles-zona-privada-otra-propuesta.css" />
	<script type="text/javascript" src="#{request.contextPath}/resources/javascript/funcionesUtiles.js"></script>
	<script type="text/javascript" src="#{request.contextPath}/resources/javascript/funciones.js"></script>
	<title><ui:insert name="title" /></title>
	<f:loadBundle basename="Msg_resources" var="msg"/>
</h:head>
<h:body>
	<script type="text/javascript">
		jQuery(document).ready(function(){
			var widthMenu = jQuery("#menu").css('width');
			jQuery("#boton-mostrar").hide();
			
	
			jQuery("#boton-ocultar").click(function(){
				jQuery("#menu").hide();
				jQuery("#boton-ocultar").hide();
				jQuery("#boton-mostrar").show();
				jQuery("#cajaPrincipal").css('margin-left', 0);
		  	});
		  	
			jQuery("#boton-mostrar").click(function(){
				jQuery("#menu").show();
				jQuery("#boton-mostrar").hide();
				jQuery("#boton-ocultar").show();
				jQuery("#cajaPrincipal").css('margin-left', widthMenu);
		  	});
		});
	
		function ajaxSessionTimeout(){
			sessionDialog.show();
		}
	
		!function( jQuery ){
			jQuery.ajaxSetup({
		        statusCode: 
		        {
		            901: ajaxSessionTimeout
		        }
		    });
		}(window.jQuery);
	</script>
	
	<div id="layout">
		<ui:include src="session-time-out-interno.xhtml" />
		<div id="header">
			<table class="header-tabla" cellspacing="0px">
				<tr>
					<td class="header-left">
						<h:panelGroup layout="block" styleClass="logo"/>					
					</td>

					<td class="header-left">
						<h:panelGroup layout="block" style="float: right;">
							<h:panelGrid columns="2">
								<h:panelGroup layout="block" styleClass="icono-usuario-autenticado" />
								
								<h:panelGroup layout="block" styleClass="nombre-usuario-autenticado">
									<h:outputText value="#{loginController.usuario.nombres} #{loginController.usuario.apellidos}" />
								</h:panelGroup>
							</h:panelGrid>
						</h:panelGroup>
					</td>
					<td class="header-right">
						<h:panelGroup layout="block" styleClass="iconos-encabezado">
							<h:panelGrid columns="3">
								<h:panelGroup layout="block" styleClass="icono-encabezado icono-encabezado-inicio" />
								
								<h:panelGroup layout="block" styleClass="icono-encabezado icono-encabezado-ayuda" />
								
								<p:commandLink action="#{loginController.cerrarSessionInterno}"
									process="@this" global="false">
									<h:panelGroup layout="block" styleClass="icono-encabezado icono-encabezado-salir" />
								</p:commandLink>
							</h:panelGrid>
						</h:panelGroup>
					</td>
				</tr>
			</table>
		</div>

		<div class="main">
			<div id="cajaPrincipal" class="cajaPrincipal">
				<div style="width: 100%">
						<div class="barra-separacion">
							<div class="barra-separacion-contenido">
								<p:commandLink id="boton-ocultar" title="#{msg['principal.ocultar']}" global="false">
									<div class="barra-separacion-sub-contenido">
										<span class="ui-icon ui-icon-triangle-1-w"></span>
									</div>
								</p:commandLink>
								<p:commandLink id="boton-mostrar" title="#{msg['principal.mostrar']}" global="false">
									<div class="barra-separacion-sub-contenido">
										<span class="ui-icon ui-icon-triangle-1-e"></span>
									</div>
								</p:commandLink>
							</div>
						</div>
	
						<div class="todito">
							<ui:insert name="content">
								<span></span>
							</ui:insert>
						</div>
					<div style="clear: both;"/>
				</div>

				<div  class="footer">
					<div  class="content-footer">
						<h:outputLabel>#{msg['sistema.footer']}</h:outputLabel>
					</div>
				</div>

			</div>

		</div>

		<div id="menu" class="menu">
			<ui:include src="zona-privada-menu.xhtml" />
		</div>
		<p:dialog showHeader="false" id="load" modal="true" width="51" appendToBody="true"
				  widgetVar="wvLoad" draggable="false" closable="false"
				  resizable="false">
			<h:graphicImage styleClass="icono-espera" library="images" name="loading.gif"/>
		</p:dialog>
		<p:ajaxStatus onstart="wvLoad.show();" onsuccess="wvLoad.hide();"/>  
	</div>
</h:body>
</html>